package com.yc.role.entity;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.base.BaseSimpleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

/**
 * <p>
 * 后台角色和菜单关系表
 * </p>
 *
 * @author bao
 * @since 2021-12-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("yc_role_menu_relation")
@ApiModel(value="RoleMenuRelation对象", description="后台角色和菜单关系表")
public class RoleMenuRelation extends BaseSimpleEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "角色id")
    @TableField("role_id")
    private Long roleId;

    @ApiModelProperty(value = "菜单id")
    @TableField("menu_id")
    private Long menuId;


    public void copy(RoleMenuRelation source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
